package com.sxkiler.demo.boot;

import com.sxkiler.demo.rpc.server.RpcServer;
import com.sxkiler.demo.utils.DaoContext;

import javax.sql.DataSource;

public class StartUp {

    public static void start(String url,String username,String password,int port) throws Exception{
        DaoContext daoContext = DaoContext.getInstance();
        DataSource dataSource = daoContext.initDataSource(url,username,password);
        daoContext.initMybatis(dataSource);
        RpcServer.startserver(port);
    }

}
